home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 1
/
Gold Medal Software Volume 1 (Gold Medal) (1994).iso
/
drivers
/
ljp3fw.arj
/
DEMOLJ3.PRG
< prev
next >
Wrap
Text File
|
1993-09-15
|
8KB
|
255 lines
#include "SET.CH"
#include "FILEIO.CH"
#include "ljprtiii.CH"
/*
this program should be compiled
clipper demolj3 /a /m /n /p /b /w >demolj3.txt
CAVEAT: this library is meant to work with a PCL 5 printer
(i.e. HP Laserjet Series III, IIIP, IIISI, Brother HLV10? etc)
if all you have is a PCL 4 printer most of this stuff
wont work and it will send lots of paper thru your printer
in the process
Note 1: for the most part I do not use the SET PRINTER, SET CONSOLE,
or SET DEVICE commands in these examples - its not necessary
and may once in a while cause problems with the printer cursor
positioning if you're careless in your use of them - BE Warned!
Note 2: do not use: #include "simpleio.ch" it will hose things badly
*/
function main()
local cS := ""
local nI := 0
local nII := 0
local nIII := 0
local nbytes := 0
local nX := 4.5
LJ_SetJob( PRINTER_RESET )
LJ_SetJob( NUMBER_OF_COPIES, 1 )
LJ_SetPage( PAGE_SIZE, LETTER )
LJ_SetPage( PAGE_LENGTH, LETTER_8_LPI_PORT )
LJ_SetPage( PAPER_SOURCE, UPPER_TRAY )
LJ_SetPage( LOGICAL_PAGE_ORIENT, REVERSE_PORTRAIT )
LJ_Send_CC( LJ_Font_SS( PRIMARY_SYMBOL_SET, ;
PC_8, ;
FIXED_SPACING, ;
8,;
16,;
UPRIGHT_SOLID, ;
MEDIUM_BOOK_OR_TEXT,;
COURIER ) ;
)
lj_Say_YX( ROWCOL, 4, 41, "a NE " )
lj_Say_YX( ROWCOL, 5, 41, "shadow box" )
// set up the array: aBoxParams
BOX_PARAM_format := ROWCOL
BOX_top_line := 3
BOX_left_side := 40
BOX_bottom_line := 6
BOX_right_side := 52
BOX_line_thickness := 0.025
BOX_RAF_option := BLACK_FILL
BOX_line_pattern := SOLID_BLACK
BOX_shadow := SHADOW_NE
lj_box( aBoxParams )
LJ_Send_CC( LJ_Font_SS( PRIMARY_SYMBOL_SET, ;
PC_8, ;
PROPORTIONAL_SPACING, ;
0,;
6,;
SHADOWED, ;
ULTRA_THIN,;
CG_TIMES ) )
lj_Say_YX( ROWCOL, 5, 64, "and a NW shadow box" )
BOX_PARAM_format := ROWCOL
BOX_top_line := 3
BOX_left_side := 60
BOX_bottom_line := 6
BOX_right_side := 72
BOX_line_thickness := 0.015
BOX_RAF_option := BLACK_FILL
BOX_line_pattern := SOLID_BLACK
BOX_shadow := SHADOW_NW
lj_box( aBoxParams )
LJ_Send_CC( LJ_Font_SS( PRIMARY_SYMBOL_SET, ;
PC_8, ;
PROPORTIONAL_SPACING, ;
6,;
6,;
UPRIGHT_SOLID, ;
EXTRA_THIN,;
UNIVERS ) )
lj_Say_YX( ROWCOL, 11, 42, "then a SE shadow box" )
BOX_PARAM_format := ROWCOL
BOX_top_line := 9
BOX_left_side := 40
BOX_bottom_line := 12
BOX_right_side := 52
BOX_line_thickness := 0.05
BOX_RAF_option := BLACK_FILL
BOX_line_pattern := SOLID_BLACK
BOX_shadow := SHADOW_SE
lj_box( aBoxParams )
LJ_Send_CC( LJ_Font_SS( PRIMARY_SYMBOL_SET, ;
PC_8, ;
PROPORTIONAL_SPACING, ;
44,;
8.5,;
OUTLINE, ;
LIGHT,;
CG_TIMES ) )
lj_Say_YX( ROWCOL, 11, 61, "and a SW shadow box" )
BOX_PARAM_format := ROWCOL
BOX_top_line := 9
BOX_left_side := 60
BOX_bottom_line := 12
BOX_right_side := 72
BOX_line_thickness := 0.0025
BOX_RAF_option := BLACK_FILL
BOX_line_pattern := SOLID_BLACK //????
BOX_shadow := SHADOW_SW
lj_box( aBoxParams )
LJ_Send_CC( LJ_Font_SS( PRIMARY_SYMBOL_SET, ;
PC_8, ;
PROPORTIONAL_SPACING, ;
44,;
12.5,;
OUTLINE, ;
LIGHT,;
CG_TIMES ) )
lj_Say_YX( ROWCOL, 14, 51, "and a NON-SHADOW box" )
BOX_PARAM_format := ROWCOL
BOX_top_line := 13
BOX_left_side := 50
BOX_bottom_line := 15
BOX_right_side := 72
BOX_line_thickness := 0.0020
BOX_RAF_option := BLACK_FILL
BOX_line_pattern := SOLID_BLACK //????
BOX_shadow := SHADOW_NONE
lj_box( aBoxParams )
// alternate method of selecting a font
cS := LJ_Font_SS( PRIMARY_SYMBOL_SET, ;
PC_8, ;
PROPORTIONAL_SPACING, ;
0,;
22,;
UPRIGHT_SOLID, ;
OUTLINE_SHADOWED,;
CG_TIMES )
LJ_Send_CC( cS )
lj_Say_YXF( ROWCOL, 4, 5, "RASTERED image", , , FLOATING_UNDERLINE_ON )
RastTest()
// HORIZONTAL LINES - top to bottom 1 - 8
LJ_Line( INCHES, 3.56, 0.0, 3.5, 0.0016, BLACK_FILL, 100 ) // line 1
LJ_Line( INCHES, 3.66, 0.0, 3.5, 0.0017, BLACK_FILL, 100 ) // line 1
LJ_Line( INCHES, 3.76, 0.0, 3.5, 0.0018, BLACK_FILL, 100 ) // line 1
LJ_Line( INCHES, 3.86, 0.0, 3.5, 0.002, BLACK_FILL, 100 ) // line 1
LJ_Line( INCHES, 4.04, 0.5, 3.5, 0.012, BLACK_FILL, 100 ) // line 2
LJ_Line( INCHES, 4.20, 1.0, 3.5, 0.022, BLACK_FILL, 100 ) // line 3
LJ_Line( INCHES, 4.34, 1.5, 3.5, 0.032, BLACK_FILL, 100 ) // line 4
LJ_Line( INCHES, 4.51, 2.0, 3.5, 0.042, BLACK_FILL, 100 ) // line 5
LJ_Line( INCHES, 4.67, 2.5, 3.5, 0.052, BLACK_FILL, 100 ) // line 6
LJ_Line( INCHES, 4.86, 3.0, 3.5, 0.062, BLACK_FILL, 100 ) // line 7
LJ_Line( INCHES, 5.01, 3.5, 3.5, 0.072, BLACK_FILL, 100 ) // line 8
// VERTICAL LINES left to right 1 - 4
LJ_Line( INCHES, 5.5, 1.0, 0.0015, 1.55, BLACK_FILL, 100 ) // line 1
LJ_Line( INCHES, 5.5, 1.3, 0.003, 1.59, BLACK_FILL, 100 ) // line 1
LJ_Line( INCHES, 5.5, 1.75, 0.013, 1.70, BLACK_FILL, 100 ) // line 2
LJ_Line( INCHES, 5.5, 2.25, 0.103, 1.24, BLACK_FILL, 100 ) // line 3
LJ_Line( INCHES, 5.5, 2.50, 0.053, 1.35, BLACK_FILL, 100 ) // line 4
// SHADED HORIZONTAL LINES - top to bottom 1 - 5
LJ_Line( INCHES, 5.70, 3.5 , 3.5, 0.167, SHADED_FILL, 10 ) // line 1
LJ_Line( INCHES, 6.04, 3.75, 3.5, 0.166, SHADED_FILL, 10 ) // line 2
LJ_Line( INCHES, 7.340, 4.0 , 3.5, 0.166, SHADED_FILL, 10 ) // line 3
LJ_Line( INCHES, 8.670, 0.35, 5.8, 0.55 , SHADED_FILL, 10 ) // line 4
LJ_LINE( INCHES, 9.670, 1.1 , 5.5, 0.33 , SHADED_FILL, 10 ) // line 5
// alternate method of selecting a font
cS := LJ_Font_SS( PRIMARY_SYMBOL_SET, ;
PC_8, ;
PROPORTIONAL_SPACING, ;
0,;
8,;
UPRIGHT_SOLID, ;
OUTLINE_SHADOWED,;
CG_TIMES )
LJ_Send_CC( cS )
LJ_SetPage( PRINT_DIRECTION, PD_REVERSE_LANDSCAPE )
lj_Say_YX( ROWCOL, 4, 14, "The shadowed boxes" )
LJ_SetPage( PRINT_DIRECTION, PD_LANDSCAPE )
lj_Say_YX( ROWCOL, 7, 34, "some vertical lines" )
LJ_SetPage( PRINT_DIRECTION, PD_REVERSE_PORTRAIT )
lj_Say_YX( ROWCOL, 5, 24, "a few shaded Lines" )
LJ_SetPage( PRINT_DIRECTION, PD_PORTRAIT )
lj_Say_YX( ROWCOL, 25, 24, "a few horizontal Lines" )
// another way to build a box - it expects an array as input parameter)
lj_box( {ROWCOL, 5.5, 9, 9, 30, 0.002 , BLACK_FILL, SOLID_BLACK, SHADOW_SW } )
LJ_Send_CC( FORM_FEED )
LJ_SetPage( LOGICAL_PAGE_ORIENT, PORTRAIT )
FormBld()
PrtInvoice()
LJ_SetJob( PRINTER_RESET )
return nil